import { useEffect, useState } from 'react'
import { Outlet, useNavigate } from 'react-router-dom'
import { Button } from 'antd'
// import FitScreen from '@fit-screen/react'
import './index.scss'

const Home = () => {
  // 实例化 navigate
  const navigate = useNavigate()

  useEffect(() => {
    navigate('/home/game')
  }, [])

  // 去登录页按钮的点击事件
  const toLogin = () => {
    // 跳转
    navigate('/login')
  }
  return (
    // <FitScreen width={1920} height={1080} mode="fit">
    <div className="home_wrap">
      <h1>首页</h1>
      <br />
      <Button type="primary" onClick={toLogin}>
        去登录页
      </Button>
      <div>
        <h2>二级页面</h2>
        <div className="home_router">
          <Outlet></Outlet>
        </div>
      </div>
    </div>
    // </FitScreen>
  )
}

export default Home
